from wxpita import *

f = SizedFrame(size=(400, 500)) [
    TreeCtrl(name='tree',
             style='tr_row_lines|tr_has_buttons',
             expand=True, proportion=1)
]

@f.Init
def _():
    tree = f.tree
    
    #print tree
    root = tree.AddRoot('Root Item')
    
    for i in range(9):
        child = tree.AppendItem(root, 'Item %d' % i)

        for j in range(4):
            child2 = tree.AppendItem(child, 'Item %d.%d' % (i,j))

        if i % 4 == 0:
            tree.Expand(child)

    tree.Expand(root)

f.Show('TreeCtrl Example')
